Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Mix_Music forward declare to include in Music.h #1255

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

DanRStevens
Copy link
Collaborator

The Mix_Music typedef points to a struct that was renamed. There's no easy way to deal with that and maintain a forward declare. We would need to forward declare for one of two possible type names, before we've seen the include that would tell us which name it should be.

I suppose we could add some pointer casting, but that should be avoided.

Considering how infrequently the Music.h header is included by other files, we're probably fine doing a full SDL include for now. Once things have stabilized on the new version we could eventually switch back to a forward declare. As a bonus, that forward declare will then be for a name that is not reserved.

Closes #1242

Related:

The `Mix_Music` typedef points to a `struct` that was renamed. There's no easy way to deal with that and maintain a forward declare. We would need to forward declare for one of two possible type names, before we've seen the include that would tell us which name it should be.

I suppose we could add some pointer casting, but that should be avoided.

Considering how infrequently the `Music.h` header is included by other files, we're probably fine doing a full SDL include for now. Once things have stabilized on the new version we could eventually switch back to a forward declare. As a bonus, that forward declare will then be for a name that is not reserved.
@DanRStevens DanRStevens merged commit c3b7ab2 into main Mar 2, 2025
8 checks passed
@DanRStevens DanRStevens deleted the musicSdlInclude branch March 2, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Music.h for SDL_Mixer 2.8.1
1 participant